package design.model.chain;

import java.util.Objects;

/**
 * @author: Eternity.麒麟
 * @description: 第二个Handler
 * @date: 2022/4/10 19:14
 * @version: 1.0
 */
public class TwoHandler extends Handler{
    @Override
    public Result execute() {
        System.out.println("第二个Handler执行");
        Handler handler = getHandler();
        if (Objects.isNull(handler)) {
            return new Result(true, "成功");
        }
        return getHandler().execute();
    }
}
